Name the Ad Manager decision in the auction trace console - #975
Draft
prk-Jr wants to merge 1 commit into
Draft
Conversation
The GAM stage collapsed every non-empty, non-backfill render into a single unattributed outcome, so a house ad, a direct-sold line item, an Ad Manager default, and a Trusted Server win whose creative never confirmed all read identically. Attribution also depended solely on the creative's cooperative acknowledgement, leaving a slot with live Trusted Server targeting unresolved forever when that acknowledgement never arrived. Retain the identifiers slotRenderEnded reports for the delivered ad and classify the render from them, credit the Ad Manager decision as soon as the rendered creative requests markup, and resolve a render the Trusted Server creative never claimed within a bounded window. Ad Manager identifiers stay in the browser and are never sent to auction telemetry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #961 — base branch is
feature/auction-creative-trace-overlay, so review this diff on its own and let GitHub retarget the base tomainonce #961 lands.The trace console could not answer the question it exists to answer: after the GAM call, did the line item Trusted Server won render, or did a house ad, a direct-sold line item, or the Ad Manager default render instead? Every non-empty, non-backfill render read as
direct_or_unattributed— "GAM rendered an ad — source not attributed".Three causes, all in the GAM stage:
slotRenderEndedidentifiers were read as booleans and discarded.lineItemIdandcreativeIdwere only tested for presence;advertiserId,campaignId,sourceAgnosticLineItemId,sourceAgnosticCreativeId,yieldGroupIds, andcompanyIdswere not read at all. Ad Manager's own report is the only authoritative statement of which line item won.reservationandunclassified_non_emptyboth fell into the single unattributed bucket.trusted_server_candidateindefinitely.Changes
crates/trusted-server-js/lib/src/integrations/gpt/index.tsslotRenderEndedidentifier set with bounded validation; arm a 5s attribution window for a render on a generation that had a Trusted Server bid; settle it when the rendered creative requests markup.crates/trusted-server-js/lib/src/core/ad_trace.tsother_reservation,gam_default_or_unclassified, andother_gam_demandoutcomes; credittrusted_server_wonatstrongconfidence on a markup request or served markup; stop later GPT callbacks from downgrading a settled win.crates/trusted-server-js/lib/src/core/types.tsAdTraceGamIdentityand thegpt_render_unclaimedevent kind.crates/trusted-server-js/lib/src/integrations/ad_trace/presentation.tscrates/trusted-server-integration-tests/browser/tests/ad-trace/auction-trace.spec.tsother_gam_demand, and the cleared-targeting render assertsother_reservationplus the reported line item ID.docs/guide/configuration.mdBehavior
The console now reports one of: Trusted Server creative selected (confirmed, or selected with the confirmation still outstanding), another reservation line item plus its Ad Manager identifiers, an Ad Manager default or backup ad, other Ad Manager demand where the Trusted Server creative never ran, backfill, or empty.
Ad Manager identifiers are the publisher's own data — the same values
?google_console=1shows — and are gated behind the existing console session. They are not added to auction telemetry.Distinguishing a house line item from a direct-sold one still requires looking the ID up in Ad Manager. Auto-labeling that needs a configured allowlist of header-bidding and house order IDs, deliberately left as a follow-up rather than guessed at here.
Test plan
cd crates/trusted-server-js/lib && npx vitest run(531 passed, 12 new)cd crates/trusted-server-js/lib && npm run formatcd crates/trusted-server-js/lib && node build-all.mjscd docs && npm run format?ts_console=true, checking a slot where GAM delivers a house ad against one where the Trusted Server creative rendersChecklist